home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
cenvid
/
cmdcount.bat
< prev
next >
Wrap
DOS Batch File
|
1994-12-01
|
1KB
|
33 lines
@echo off
REM ***************************************************
REM *** CmdCount.bat - Repeat a command some number ***
REM *** ver.2 of times. ***
REM ***************************************************
REM ****************************************
REM *** If no commands specified, then ***
REM *** give instructions for how to use ***
REM ****************************************
IF NOT "%2"=="" GOTO REPEAT_COMMAND
ECHO CMDCOUNT.BAT - Repeat a command a number of times
ECHO USAGE: CMDCOUNT Count Commands...
ECHO WHERE: Count - Number of times to repeat command
ECHO Commands... - Any DOS command to repeat
ECHO EXAMPLE: CMDCOUNT 5 COPY ALL.TXT+MYLINE.TXT
GOTO BYE_BYE
:REPEAT_COMMAND
REM **********************************************
REM *** START COUNT ENVIRONMENT VARIABLE AT 0 ***
REM *** LOOP THROUGH COMMANDS UNTIL IT REACHES ***
REM *** THE FIRST INPUT VARIABLE ***
REM **********************************************
SET COUNT=0
:TOP_OF_LOOP
%2 %3 %4 %5 %6 %7 %8 %9
CEnviD COUNT = COUNT + 1
IF NOT %COUNT%==%1 GOTO TOP_OF_LOOP
:BYE_BYE
SET COUNT=